<?php
namespace App\Http\Controllers\Search;
use App\Http\Controllers\ApiBaseController;
use Illuminate\Http\Request;
use App\Models\DyModels\KeywordVideoComment;
class KeywordVideoCommentAjaxController extends ApiBaseController {
  public function __construct(Request $request) {
    parent::__construct($request);
  }
  
  /**
   * 列表
   */
  public function dataList(){
    $oKeywordVideoComment = new KeywordVideoComment();
    $result = $oKeywordVideoComment->getPageData($this->params);
    echo json_encode($result);
  }
	
	//修改关键词视频评论显示状态
	function status(){
		$oKeywordVideoComment = new KeywordVideoComment();
		$kid=isset($this->params['kid']) ? intval($this->params['kid']) : 0;
		$status=isset($this->params['status']) ? intval($this->params['status']) : 0;
		
		$re=$oKeywordVideoComment->upKCStatus($kid,$status);
		$re ? $this->returnJson(0,'修改成功') : $this->returnJson(1,'修改失败');
	}
	
	//修改关键词视频评论的联系方式
	function info(){
		$oKeywordVideoComment = new KeywordVideoComment();
		$kid=isset($this->params['kid']) ? intval($this->params['kid']) : 0;
		$text=isset($this->params['text']) ? htmlspecialchars($this->params['text'],ENT_QUOTES) : '';
		$data=['tells'=>$text];
		$re=$oKeywordVideoComment->db_update('',$kid,$data);
		$re ? $this->returnJson(0,'修改成功') : $this->returnJson(1,'修改失败');
	}
	
	//作品雷达评论
	function infoAjax(){
		$oKeywordVideoComment = new KeywordVideoComment();
		$result = $oKeywordVideoComment->getInfoData($this->params);
		echo json_encode($result);
	}
	//修改作品雷达评论联系方式
	function edit(){
		$oKeywordVideoComment = new KeywordVideoComment();
		$kid=isset($this->params['kid']) ? intval($this->params['kid']) : 0;
		$text=isset($this->params['text']) ? htmlspecialchars($this->params['text'],ENT_QUOTES) : '';
		$data=['tells'=>$text];
		$re=$oKeywordVideoComment->infoCommentEdit($kid,$data);
		$re ? $this->returnJson(0,'修改成功') : $this->returnJson(1,'修改失败');
	}
}
